local _, Ovale = ...
local OvaleScripts = Ovale.OvaleScripts

do
	local name = "ovale_mage_spells"
	local desc = "[5.4.7] Ovale: Mage spells"
	local code = [[
# Mage spells and functions.

Define(alter_time 108978)
	SpellInfo(alter_time cd=180)
Define(alter_time_activate 108978)
Define(alter_time_buff 110909)
	SpellInfo(alter_time_buff duration=6)
Define(arcane_barrage 44425)
	SpellInfo(arcane_barrage cd=3)
	SpellAddDebuff(arcane_barrage arcane_charge_debuff=0 if_spell=arcane_charge)
Define(arcane_blast 30451)
	SpellAddDebuff(arcane_blast arcane_charge_debuff=1 if_spell=arcane_charge)
	SpellAddBuff(arcane_blast profound_magic_buff=0 itemset=T16_caster itemcount=2 specialization=arcane)
Define(arcane_brilliance 1459)
Define(arcane_charge 114664)
Define(arcane_charge_debuff 36032)
	SpellInfo(arcane_charge_debuff duration=10 maxstacks=4)
Define(arcane_explosion 1449)
	SpellAddDebuff(arcane_explosion arcane_charge_debuff=refresh if_spell=arcane_charge)
Define(arcane_missiles 5143)
	SpellInfo(arcane_missiles duration=2)
	SpellAddDebuff(arcane_missiles arcane_charge_debuff=1 if_spell=arcane_charge)
Define(arcane_missiles_buff 79683)
	SpellInfo(arcane_missiles_buff duration=20 maxstacks=2)
Define(arcane_power 12042)
	SpellInfo(arcane_power cd=90)
	SpellInfo(arcane_power addcd=90 glyph=glyph_of_arcane_power)
	SpellAddBuff(arcane_power arcane_power_buff=1)
Define(arcane_power_buff 12042)
	SpellInfo(arcane_power_buff duration=15)
	SpellInfo(arcane_power_buff addduration=15 glyph=glyph_of_arcane_power)
Define(blink 1953)
	SpellInfo(blink cd=15)
Define(blizzard 10)
	SpellInfo(blizzard channel=8 haste=spell)
Define(brain_freeze_buff 57761)
	SpellInfo(brain_freeze_buff duration=15)
Define(brilliant_mana_gem 81901)
Define(cold_snap 11958)
	SpellInfo(cold_snap cd=180)
Define(cold_snap_talent 12)
Define(combustion 11129)
	SpellInfo(combustion cd=45)
	SpellInfo(combustion cd=90 glyph=glyph_of_combustion)
	SpellInfo(combustion cd=36 itemset=T14 itemcount=4)
	SpellInfo(combustion cd=72 glyph=glyph_of_combustion itemset=T14 itemcount=4)
	SpellAddTargetDebuff(combustion combustion_debuff=1)
Define(combustion_debuff 83853)
	SpellInfo(combustion_aura duration=10 haste=spell tick=1)
	SpellInfo(combustion_aura addduration=10 glyph=glyph_of_combustion)
Define(cone_of_cold 120)
	SpellInfo(cone_of_cold cd=10)
Define(conjure_brilliant_mana_gem 119316)
Define(conjure_mana_gem 759)
Define(counterspell 2139)
	SpellInfo(counterspell cd=24)
Define(deep_freeze 44572)
	SpellInfo(deep_freeze cd=30)
	SpellAddBuff(deep_freeze fingers_of_frost_buff=-1)
Define(evocation 12051)
	SpellInfo(evocation cd=120 channel=3 haste=spell)
	SpellInfo(evocation cd=0 talent=invocation_talent)
	SpellAddBuff(evocation evocation_buff=1)
	SpellAddDebuff(evocation arcane_charge_debuff=0 if_spell=arcane_charge)
Define(evocation_buff 12051)
	SpellInfo(evocation_buff duration=6 haste=spell tick=2)
	SpellInfo(evocation_buff duration=3 haste=spell tick=1 talent=invocation_talent)
Define(fingers_of_frost_buff 44544)
	SpellInfo(fingers_of_frost_buff duration=15 maxstacks=2)
Define(fire_blast 2136)
	SpellInfo(fire_blast cd=8)
Define(fireball 133)
	SpellInfo(fireball base=1561 bonussp=1.5)
	SpellDamageDebuff(fireball pyromaniac_debuff=1.1)
Define(flamestrike 2120)
	SpellInfo(flamestrike cd=12 duration=8 haste=spell tick=2)
Define(frost_armor 7302)
Define(frost_armor_buff 7302)
Define(frost_bomb 112948)
	SpellInfo(frost_bomb cd=10 cd_haste=spell)
	SpellAddTargetDebuff(frost_bomb frost_bomb_debuff=1)
	SpellAddTargetDebuff(frost_bomb pyromaniac_debuff=1 if_spell=pyromaniac)
Define(frost_bomb_debuff 112948)
	SpellInfo(frost_bomb_debuff duration=4 haste=spell tick=4)
Define(frost_bomb_talent 15)
Define(frostbolt 116)
	SpellAddBuff(frostbolt frozen_thoughts_buff=0 itemset=T16_caster itemcount=2 specialization=frost)
Define(frostfire_bolt 44614)
	SpellAddBuff(frostfire_bolt brain_freeze_buff=0 specialization=frost)
	SpellAddBuff(frostfire_bolt frozen_thoughts_buff=0 itemset=T16_caster itemcount=2 specialization=frost)
	SpellDamageDebuff(frostfire_bolt pyromaniac_debuff=1.1)
Define(frozen_orb 84714)
	SpellInfo(frozen_orb cd=60)
Define(frozen_thoughts_buff 146557)
	SpellInfo(frozen_thoughts_buff duration=15)
Define(glyph_of_arcane_power 62210)
Define(glyph_of_combustion 56368)
Define(glyph_of_cone_of_cold 115705)
Define(glyph_of_icy_veins 56364)
Define(glyph_of_loose_mana 56363)
Define(glyph_of_mana_gem 56383)
Define(heating_up_buff 48107)
	SpellInfo(heating_up_buff duration=10)
Define(ice_barrier 11426)
	SpellInfo(ice_barrier cd=25)
Define(ice_barrier_talent 6)
Define(ice_floes 108839)
	SpellAddBuff(ice_floes ice_floes_buff=1)
Define(ice_floes_buff 108839)
	SpellInfo(ice_floes_buff duration=15)
Define(ice_floes_talent 3)
Define(ice_lance 30455)
	SpellAddBuff(ice_lance fingers_of_frost_buff=-1)
	SpellAddBuff(ice_lance frozen_thoughts_buff=0 itemset=T16_caster itemcount=2 specialization=frost)
Define(icy_veins 12472)
	SpellInfo(icy_veins cd=180 duration=20)
	SpellInfo(icy_veins addcd=-90 itemset=T14 itemcount=4)
	SpellAddBuff(icy_veins icy_veins=1)
Define(icy_veins_glyphed 131078)
	SpellInfo(icy_veins_glyphed cd=180 duration=20)
	SpellInfo(icy_veins_glyphed addcd=-90 itemset=T14 itemcount=4)
	SpellAddBuff(icy_veins_glyphed icy_veins_glyphed=1)
SpellList(icy_veins_buff 12472 131078)
Define(ice_ward 111264)
	SpellInfo(ice_ward cd=20)
	SpellAddTargetBuff(ice_ward ice_ward_buff=1)
Define(ice_ward_buff 111264)
	SpellInfo(ice_ward_buff duration=30)
Define(ice_ward_talent 8)
Define(ignite_debuff 12654)
	SpellInfo(ignite_debuff duration=4 tick=2)
Define(incanters_ward 1463)
	SpellInfo(incanters_ward cd=25)
	SpellAddBuff(incanters_ward incanters_ward_buff=1)
Define(incanters_ward_buff 1463)
	SpellInfo(incanters_ward_buff duration=8)
Define(incanters_ward_talent 18)
Define(inferno_blast 108853)
	SpellInfo(inferno_blast cd=8)
	SpellInfo(inferno_blast base=624.5 bonussp=0.6)
	SpellDamageDebuff(inferno_blast pyromaniac_debuff=1.1)
Define(invocation_talent 16)
Define(invokers_energy_buff 116257)
	SpellInfo(invokers_energy_buff duration=60)
Define(living_bomb 44457)
	SpellInfo(living_bomb gcd=1)
	SpellAddTargetDebuff(living_bomb living_bomb_debuff=1)
	SpellAddTargetDebuff(living_bomb pyromaniac_debuff=1 if_spell=pyromaniac)
Define(living_bomb_debuff 44457)
	SpellInfo(living_bomb duration=12 haste=spell tick=3)
Define(living_bomb_talent 14)
Define(mage_armor 6117)
Define(mage_armor_buff 6117)
Define(mana_gem 36799)
Define(mirror_image 55342)
	SpellInfo(mirror_image cd=180)
Define(molten_armor 30482)
Define(molten_armor_buff 30482)
Define(nether_tempest 114923)
	SpellAddTargetDebuff(nether_tempest nether_tempest_debuff=1)
	SpellAddTargetDebuff(nether_tempest pyromaniac_debuff=1 if_spell=pyromaniac)
Define(nether_tempest_debuff 114923)
	SpellInfo(nether_tempest_debuff duration=12 haste=spell tick=1)
Define(nether_tempest_talent 13)
Define(potent_flames_buff 145254)
	SpellInfo(potent_flames_buff duration=5 maxstacks=5)
Define(presence_of_mind 12043)
	SpellInfo(presence_of_mind cd=90)
	SpellAddBuff(presence_of_mind presence_of_mind_buff=1)
Define(presence_of_mind_buff 12043)
	SpellInfo(presence_of_mind_buff duration=86400)	# XXX
Define(presence_of_mind_talent 1)
Define(profound_magic_buff 145252)
	SpellInfo(profound_magic_buff duration=10)
Define(pyroblast 11366)
	SpellInfo(pyroblast base=2061 bonussp=1.98)
	SpellAddBuff(pyroblast pyroblast_buff=0)
	SpellAddTargetDebuff(pyroblast pyroblast_debuff=1)
	SpellDamageBuff(pyroblast pyroblast_buff=1.25)
	SpellDamageDebuff(pyroblast pyromaniac_debuff=1.1)
Define(pyroblast_buff 48108)
	SpellInfo(pyroblast_buff duration=15)
Define(pyroblast_debuff 11366)
	SpellInfo(pyroblast_debuff duration=18 haste=spell tick=3)
	SpellInfo(pyroblast_debuff base=2061 bonussp=1.98)
Define(pyromaniac 132209)
Define(pyromaniac_debuff 132210)
	SpellInfo(pyromaniac_debuff duration=15)
Define(rune_of_power 116011)
	SpellAddBuff(rune_of_power rune_of_power_buff=1)
Define(rune_of_power_buff 116014)
	SpellInfo(rune_of_power_buff duration=60)
Define(rune_of_power_talent 17)
Define(scorch 2948)
Define(spellsteal 30449)
Define(temporal_shield 115610)
	SpellInfo(temporal_shield cd=25)
Define(temporal_shield_talent 4)
Define(time_warp 80353)
	SpellInfo(time_warp cd=300)
Define(water_elemental 31687)
	SpellInfo(water_elemental cd=60)
Define(water_elemental_freeze 33395)
	SpellInfo(water_elemental_freeze cd=25)
]]

	OvaleScripts:RegisterScript("MAGE", name, desc, code, "include")
end
